//	ID : pallab81
// 	PROG : 571
// 	LANG : C++
// 	2011-08-30-17.18.38 Tuesday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define fo(i,st,ed) for(int i = st ; i < ed ; ++i )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )

inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}
int A,B,C;
int dp[1101][1101];

string ss[6]={"fill A","fill B","empty A","empty B","pour A B","pour B a"};

int go(int a, int b){

    if(a==C || b==C){
        return 0;
    }
    if(dp[a][b]!=-1){
        return dp[a][b];
    }
    //cout<<a<<" "<<b<<" "<<C<<"\n";wait(.3);
    int &best = dp[a][b];
    best = (int)1e9;
    //fill a jug
    //fill a
    int x1 = 1+go(A,b);
    best = x1 < best ? x1 : best;
    //fill b
    int x2 = 1+go(a,B);
    best = x2 < best ? x2 : best;
    //empty a jug
    //empty a
    int x3 = 1+go(0,b);
    best = x3 < best ? x3 : best;
    //empty b
    int x4 = 1+go(a,0);
    best = x4 < best ? x4 : best;


        int b_nite_parbe = B-b;
        int a_dite_parbe = a;
        int exchange = min( b_nite_parbe, a_dite_parbe);
        int x5 = 1+go( a-exchange, b+exchange);
        best = x5 < best ? x5 : best;

        int a_nite_parbe = A-a;
        int b_dite_parbe = b;
        int exchange_= min( a_nite_parbe, b_dite_parbe) ;
        int x6 = 1+go( a+a_nite_parbe, b-b_dite_parbe);
        best = x6 < best ? x6 : best;

    return best;//
}

inline void bk_track(int a, int b){
    if(a==C || b==C){
        return ;
    }
    int x1 = 1+go(A,b);
    int x2 = 1+go(a,B);
    int x3 = 1+go(0,b);
    int x4 = 1+go(a,0);
    int b_ = B-b;
    int a_ = a;
    int e_ = min(b_,a_);
    int x5 = 1+go(a-e_,b+e_);

    int aa_=A-a;
    int bb_=b;
    int ee_=min(aa_,bb_);
    int x6 = 1+go(a+ee_,b-ee_);
    vector< pair<int,int> > v;
    v.pb( mk(x1,0) );
    v.pb( mk(x2,1) );
    v.pb( mk(x3,2) );
    v.pb( mk(x4,3) );
    v.pb( mk(x5,4) );
    v.pb( mk(x6,5) );
    sort(v.begin(),v.end(), less< pair<int,int> >() );

    int id=v[0].s;
    cout<<ss[id]<<"\n";
    if(id==0)
        bk_track(A,b);
    else if(id==1)
        bk_track(a,B);
    else if(id==2)
        bk_track(0,b);
    else if(id==3)
        bk_track(a,0);
    else if(id==4)
        bk_track(a-e_,b+e_);
    else if(id==5)
        bk_track(a+ee_,b-ee_);

}

inline void doit(){
    SET(dp,-1);
    go(0,0);
    bk_track(0,0);
    printf("success\n");
}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("in.txt","rt",stdin);
    #endif

    while( scanf("%d %d %d",&A,&B,&C)==3 ){
        doit();
    }

return 0;
}

